<include file="public/header" />
  <link rel="stylesheet"  href="__ADMIN__/css/global.css">
  <link rel="stylesheet"  href="__ADMIN__/css/master.css" type="text/css" />
  <link rel="stylesheet" href="__ADMIN__/css/jquery.treeTable.css"  type="text/css" />
   
  <script type="text/javascript"  src="__ADMIN__/js/jquery-1.11.0.js"  charset="utf-8"></script>
  <script type="text/javascript"  src="__ADMIN__/js/jquery.ui.js"></script>
  <script type="text/javascript"  src="__ADMIN__/js/jquery.treeTable.js"></script>
  <script type="text/javascript"  src="__ADMIN__/plugins/layui/layui.all.js" ></script>
  <style type="text/css">
    #dnd-example th{text-align:center; }
  </style>
  		<script>
	//全局变量
	var GV = {
	};
</script>
  <script type="text/javascript">
    $(document).ready(function() {
      $("#dnd-example").treeTable();
      $("#dnd-example .file, #dnd-example .folder").draggable({
        helper: "clone",
        opacity: .75,
        refreshPositions: true, // Performance?
        revert: "invalid",
        revertDuration: 300,
        scroll: true
      });

      $("#dnd-example .folder").each(function() {
        $($(this).parents("tr")[0]).droppable({
          accept: ".file, .folder",
          drop: function(e, ui) {
            $($(ui.draggable).parents("tr")[0]).appendBranchTo(this);
          },
          hoverClass: "accept",
          over: function(e, ui) {
            if(this.id != ui.draggable.parents("tr.parent")[0].id && !$(this).is(".expanded")) {
              $(this).expand();
            }
          }
        });
      });
      // Make visible that a row is clicked
      $("table#dnd-example tbody tr").mousedown(function() {
        $("tr.selected").removeClass("selected"); // Deselect currently selected rows
        $(this).addClass("selected");
      });
      // Make sure row is selected when span is clicked
      $("table#dnd-example tbody tr span").mousedown(function() {
        $($(this).parents("tr")[0]).trigger("mousedown");
      });
    });
  </script>
  <!-- END Plugin Code -->
</head>

	<body style="background: #fff;">
		<div class="layui-field-box">
		
				  <blockquote class="layui-elem-quote">
							<div class="layui-inline fr ml20" >
								<button class="layui-btn layui-btn-normal" id="refresh_wrapper">
									<i class="layui-icon">&#xe666;</i>
								</button>
							</div>
				    <div class="layui-inline  fr mr10"> 
				      	<a href="{:url('menu/add')}" class="layui-btn" >
				        	<i class="layui-icon">&#xe608;</i>&nbsp;&nbsp;添加新菜单
				      	</a>
				    </div>
				    <div class="clear"></div>
				  </blockquote>
			  
			  <form class="layui-form J_ajaxForm" action="{:url('Menu/listorders')}" method="post">
			    	<table id="dnd-example" class="site-table">
			      		<thead>
						        <tr>
									<th width="8%">正序排序</th>
						            <if condition="$app_debug eq true">
						                <th width="8%">菜单ID</th>
										<th width="13%">应用</th>
									</if>
									<th>菜单名称</th>
						            <if condition="$app_debug eq true">
									    <th width="15%">状态</th>
										<th width="20%">管理操作</th>
									</if>
						        </tr>
			      		</thead>
			      		<tbody>
			      				{$categorys}
			      		</tbody>
			    </table>
				    
				    <div>
				      <a class="layui-btn J_ajax_submit_savebtn" >保存排序</a>
				    </div>
			  </form>
		</div>

<script src="__ADMIN__/js/ajaxForm.js"   type="text/javascript" ></script>
<script src="__ADMIN__/js/user.js" 			type="text/javascript"></script>
</body>
</html>